package com.mini.enums;

import cn.hutool.core.util.EnumUtil;
import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;

public enum ReceiveStatus {


    UNKNOWN("0", "未知"), RECEIVED("1", "已接收");

    @EnumValue
    @JsonValue
    private final String code;
    private final String info;

    ReceiveStatus(String code, String info) {
        this.code = code;
        this.info = info;
    }

    public String getCode() {
        return code;
    }

    public String getInfo() {
        return info;
    }

    public static ReceiveStatus getBy(String code) {
        return EnumUtil.getBy(ReceiveStatus::getCode, code);
    }
}
